package io;

import java.io.Serializable;
import java.util.Arrays;

public class Student implements Serializable {
    //私有属性 共开构造 公开getter/setter 重写toString()
    private String name;
    private int gae;
    private String gender;
    private String[] otherInfo;
//    private transient String[] otherInfo;//被transient修饰后 此对象序列化是会被忽略

    public Student() {
    }

    public Student(String name, int gae, String gender, String[] otherInfo) {
        this.name = name;
        this.gae = gae;
        this.gender = gender;
        this.otherInfo = otherInfo;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", gae=" + gae +
                ", gender='" + gender + '\'' +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getGae() {
        return gae;
    }

    public void setGae(int gae) {
        this.gae = gae;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String[] getOtherInfo() {
        return otherInfo;
    }

    public void setOtherInfo(String[] otherInfo) {
        this.otherInfo = otherInfo;
    }
}
